package edu.mvcframework.pojo;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

/**
 * @author 王瑞
 * @description:
 * @date 2020/2/21  14:59
 */
public class Handler {
    private Object cotrollerObj;

    private Method method;

    private Pattern pattern;

    private Map<String,Integer> paramIndexMapping = new HashMap<>();

    public Handler(Object cotrollerObj, Method method, Pattern pattern) {
        this.cotrollerObj = cotrollerObj;
        this.method = method;
        this.pattern = pattern;
    }

    public Object getCotrollerObj() {
        return cotrollerObj;
    }

    public void setCotrollerObj(Object cotrollerObj) {
        this.cotrollerObj = cotrollerObj;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public Pattern getPattern() {
        return pattern;
    }

    public void setPattern(Pattern pattern) {
        this.pattern = pattern;
    }

    public Map<String, Integer> getParamIndexMapping() {
        return paramIndexMapping;
    }

    public void setParamIndexMapping(Map<String, Integer> paramIndexMapping) {
        this.paramIndexMapping = paramIndexMapping;
    }

    @Override
    public String toString() {
        return "Handler{" +
                "cotrollerObj=" + cotrollerObj +
                ", method=" + method +
                ", pattern=" + pattern +
                ", paramIndexMapping=" + paramIndexMapping +
                '}';
    }
}
